package com.lemon.smartsafetynew.ui.adapter.task;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.lemon.smartsafetynew.ui.fragment.task.InspectionTaskFragment;

import java.util.List;

/**
 * Created by JiangAn on 2018/5/7.
 */

public class InspectionTaskAdapter extends FragmentStatePagerAdapter {
    private String[] mTitles;
    private List<InspectionTaskFragment> mList;
    public InspectionTaskAdapter(FragmentManager fm, String[] mTitles, List<InspectionTaskFragment> mList) {
        super(fm);
        this.mTitles = mTitles;
        this.mList = mList;
    }

    @Override
    public Fragment getItem(int position) {
        //return SafePatrolTaskListFragment.newInstance(position);
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }

}